<?php

class User_Controller_Browse_Find extends Nuo_Controller
{
	function execute($request)
	{
		$user = Nuo::getUser();

		$memberTable = Nuo::getTable('membership/member');
		$userTable = Nuo::getTable('user');

		$select1 = $memberTable -> select() 
		-> from(array('f' => $memberTable -> getName()), 'f.user_id')
		-> where('f.resource_id=?', $user -> getItemId());

		$select = $userTable -> select() 
		-> from(array('u' => $userTable -> getName()))
		-> where('u.user_id NOT IN ?', $select1) 
		-> where('u.user_id <> ?', $user -> getId());

		$paging = Nuo_Paging::factory($select);

		/**
		 * boot up
		 */
		$ids = array();
		foreach ($paging as $item)
		{
			$ids[] = $item -> getId();
		}

		$friendStatus = array();

		return  $this -> render(array(
			'paging' => $paging,
			'friendStatus' => $friendStatus,
		));
	}

}
